<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/index.css">
    <script src="/static/js/jquery.js"></script>
    <script src="/static/layui/layui.js"></script>
    <script src="/static/js/public.js"></script>
    <script src="/static/js/vue.js"></script>
</head>
<body>
<div class="main" id="app">

    <div class="header">
        <div class="header-center fl">
            <div class="header-title">
                登录界面
            </div>
            <div class="header-img"></div>
        </div>
        <div class="header-bottom fl"></div>

    </div>

    <div class="content">
        <div class="content-left">
            <!--<img src="images/d.png" alt="">-->
        </div>
        <div id="login-form" class="content-right">
            <div class="right-infp">
                <div class="right-infp-name">
                    <input type="text" name="username" v-model="loginInfo.username" placeholder="请输入用户名" maxlength="16" required="" autocomplete="off">
                </div>
                <div class="right-infp-name">
                    <input type="password" name="password" v-model="loginInfo.password" placeholder="请输入用密码" autocomplete="off">
                </div>

                <div class="right-infp-btn">
                    <button id="login-btn" class="btn" @click="login">登  录</button>
                </div>
                <div style="text-align: right">
                    <a href="register" style="color: white">没有账号，去注册？</a>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/model/public.js"></script>
<script>
    var whei = $(window).width()
    $("html").css({ fontSize: whei / 24 });
    $(window).resize(function () {
        var whei = $(window).width();
        $("html").css({ fontSize: whei / 24 })
    });

    layui.use(['layer','message']);

    let vm = new Vue({
        el: '#app',
        data: {
            loginInfo: {
                username: "admin",
                password: "123456",
            }
        },
        components:{
        },
        methods: {
            login: function () {
                Public.login(this.loginInfo,function (res) {
                    if(res.code==0){
                        layui.message.msg(res.msg)
                    }else{
                        layui.message.error(res.msg)
                    }
                })
                return false
            }
        }
    });
</script>
</body>
</html>
